package com.cms.recursoshumanos.facade;

import com.cms.recursoshumanos.constant.Constant;
import com.cms.recursoshumanos.handler.WServiceCall;
import com.cms.recursoshumanos.json.me.JSONParser;
import com.cms.recursoshumanos.json.object.JsonObjectGetHospital;

public class ListaHospitalActivityFacade 
{

	private String strUsername;
	private String strPass;
	private int intIdSeguro;

	
	public ListaHospitalActivityFacade(String user,
										String password,
										int id_seguro)
	{
		this.strUsername = user;
		this.strPass = password;
		this.intIdSeguro = id_seguro;
		
	}
	
	public String enviarSolicitud()
	{
		 
		JSONParser jParser = new JSONParser();
		return setValores(jParser.
						getJSONFromUrl(
								Constant.URL_WEBSERVICE, 
								WServiceCall.getInstance().getListaHospital(strUsername,strPass,intIdSeguro)));

	}
	
	public String setValores(String strResult)
	{

		JsonObjectGetHospital.getInstance().fromJSON(strResult);
		return JsonObjectGetHospital.getInstance().getResult();
			
	}
	
	
}
